package com.ruoyi.ybUpload.service.tableCode.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.ybUpload.domain.ZsStockTaking;
import com.ruoyi.ybUpload.mapper.ZsStockTakingMapper;
import com.ruoyi.ybUpload.service.tableCode.IZsStockTakingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 商品盘存Service业务层处理
 *
 * @author ruoyi
 * @date 2024-09-04
 */
@Service
public class ZsStockTakingServiceImpl implements IZsStockTakingService
{
    @Autowired
    private ZsStockTakingMapper zsStockTakingMapper;

    /**
     * 查询商品盘存
     *
     * @param id 商品盘存主键
     * @return 商品盘存
     */
    @Override
    public ZsStockTaking selectZsStockTakingById(Long id)
    {
        return zsStockTakingMapper.selectZsStockTakingById(id);
    }

    /**
     * 查询商品盘存列表
     *
     * @param zsStockTaking 商品盘存
     * @return 商品盘存
     */
    @Override
    public List<ZsStockTaking> selectZsStockTakingList(ZsStockTaking zsStockTaking)
    {
        return zsStockTakingMapper.selectZsStockTakingList(zsStockTaking);
    }

    /**
     * 新增商品盘存
     *
     * @param zsStockTaking 商品盘存
     * @return 结果
     */
    @Override
    public int insertZsStockTaking(ZsStockTaking zsStockTaking)
    {
        zsStockTaking.setDelFlag(0L);
        zsStockTaking.setCreateTime(DateUtils.getNowDate());
        return zsStockTakingMapper.insertZsStockTaking(zsStockTaking);
    }

    /**
     * 修改商品盘存
     *
     * @param zsStockTaking 商品盘存
     * @return 结果
     */
    @Override
    public int updateZsStockTaking(ZsStockTaking zsStockTaking)
    {
        zsStockTaking.setUpdateTime(DateUtils.getNowDate());
        return zsStockTakingMapper.updateZsStockTaking(zsStockTaking);
    }

    /**
     * 批量删除商品盘存
     *
     * @param ids 需要删除的商品盘存主键
     * @return 结果
     */
    @Override
    public int deleteZsStockTakingByIds(Long[] ids)
    {
        return zsStockTakingMapper.deleteZsStockTakingByIds(ids);
    }

    /**
     * 删除商品盘存信息
     *
     * @param id 商品盘存主键
     * @return 结果
     */
    @Override
    public int deleteZsStockTakingById(Long id)
    {
        return zsStockTakingMapper.deleteZsStockTakingById(id);
    }
}